package com.zl.providerribbon.controller;

import com.zl.common.mapper.UserMapper;
import com.zl.common.model.User;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author zhouliang
 * @date 2019/11/13 17:49
 */
@Slf4j
@RestController
@RequestMapping("/provider")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class ProviderController {

    private final UserMapper userMapper;

    @GetMapping(value = "/findUserById/{id}", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public User findUserById(@PathVariable("id") Long id) {
        log.info("findUserById被调用，id为:{}", id);
        return userMapper.selectByPrimaryKey(id);
    }
}
